<!DOCTYPE html>
<html lang="zh-CN">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <style>
    /* CSS样式 */
    .container {
      perspective: 1000px;
      /* 定义透视距离 */
      width: 300px;
      height: 300px;
      margin: 0 auto;
    }

    img {
      width: 100%;
      height: 100%;
      /* 保持3D变换 */
      transform-style: preserve-3d;
      /* 定义过渡效果 */
      transition: transform 3s;
      animation: roa 2s linear infinite;
    }

    @keyframes roa {
      0% {
        transform: rotateY(0deg);
      }

      100% {
        transform: rotateY(360deg);
      }
    }

    /* --- */
    /* CSS样式 */
    .container {
      perspective: 1000px;
      /* 定义透视距离 */
      width: 300px;
      height: 300px;
      margin: 0 auto;
    }

    .ball {
      width: 100px;
      height: 100px;
      border-radius: 50%;
      background-image: url('./温度@2x.png');
      background-size: 100% 100%;
      position: absolute;
      top: 50%;
      left: 50%;
      transform-style: preserve-3d;
      animation: rotate 3s linear infinite;
    }

    /* 定义动画 */
    @keyframes rotate {
      0% {
        transform: translateZ(-100px) rotateY(0deg);
        /* 初始位置 */
      }

      100% {
        transform: translateZ(-100px) rotateY(360deg);
        /* 终止位置 */
      }
    }
  </style>
</head>

<body>
  <!-- <div class="container">
    <img src="./温度@2x.png" alt="3D旋转图片">
  </div> -->
  <!-- HTML结构 -->
  <div class="container">
    <div class="ball"></div>
  </div>
</body>

</html>